package com.lingyue.commons.constants;

import java.util.ArrayList;
import java.util.List;

/**
 * 选项枚举 1-SF 2-AFS 3-UC 4-CRM
 *
 * @author deep.wu
 * @version 1.0 on 2020/2/8
 */
public class CampaignTypeOption {

    public static final String OPTION_1 = "1";
    public static final String OPTION_2 = "2";
    public static final String OPTION_3 = "3";
    public static final String OPTION_4 = "4";

    public static final String OPTION_SF = "SF";
    public static final String OPTION_AFS = "AFS";
    public static final String OPTION_UC = "UC";
    public static final String OPTION_CRM = "CRM";
    public static final String OPTION_DEFAULT = "";

    public static List<String> getOption() {
        List<String> resultList = new ArrayList<>();
        resultList.add(OPTION_AFS);
        resultList.add(OPTION_SF);
        resultList.add(OPTION_UC);
        resultList.add(OPTION_CRM);
        return resultList;
    }

    public static String convertToStr(Object option) {
        if (option == null) {
            return null;
        }
        switch (option.toString().toUpperCase()) {
            case OPTION_1:
            case OPTION_SF:
                return OPTION_SF;
            case OPTION_2:
            case OPTION_AFS:
                return OPTION_AFS;
            case OPTION_3:
            case OPTION_UC:
                return OPTION_UC;
            case OPTION_4:
            case OPTION_CRM:
                return OPTION_CRM;
            default:
                return OPTION_DEFAULT;
        }
    }
}